//-
//- 
//-
package com.ntf.games.framework;

import java.util.ArrayList;

////////////
//- @author Me
//-
//- 
//-
public class ScreenManager
{
  // ////////////////////
  // -
  public ArrayList<Screen> m_currentScreens;

  // ////////////////////
  // -
  public ScreenManager()
  {
    this.m_currentScreens = new ArrayList<Screen>( 4);
  }

  // ////////////////////
  // -
  public void insertScreen( int index, Screen _screen)
  {
    this.m_currentScreens.add( index, _screen);
  }

  // ////////////////////
  // -
  public void addScreen( Screen _screen)
  {
    this.m_currentScreens.add( _screen);
  }

  // ////////////////////
  // -
  public Screen removeScreen( int index)
  {
    Screen sRetVal = null;
    if( (index >= 0) && (index < this.m_currentScreens.size()))
    {
      sRetVal = this.m_currentScreens.remove( index);
    }
    return(sRetVal);
  }

  // ////////////////////
  // -
  public Screen removeScreen( Screen screen)
  {
    Screen sRetVal = null;
    int index = this.m_currentScreens.indexOf( screen);
    sRetVal = this.removeScreen( index);
    return(sRetVal);
  }

  // ////////////////////
  // -
}
